The present invention relates generally to a programmable controller (hereinafter abbreviated as the xe2x80x9cPLCxe2x80x9d) which is configured such that intelligent modules can be connected thereto, and more particularly to the processing of user programs for a CPU module and such intelligent modules.
A prior art PLC will be first described with reference to FIG. 2. Generally, the PLC is programmed by the user using an appropriate peripheral device such that the PLC performs operations desired by the user. A program for use with the PLC is transferred to a CPU module 1 through a peripheral device connected thereto, and stored in a user memory 3 within the CPU module 1 or in a memory of a separate storage module. This program is executed by a processing unit 2 in the CPU module 1.
An intelligent module 5 may be incorporated in the PLC when it is desired to realize a control which exhibits superior response performance. This module has a unique program system and therefore operates independently of programs stored in the CPU module 1. For this reason, the intelligent module 5 only communicates data with the CPU module 1 through a system bus 9 and a PI/O bus 9xe2x80x2. As illustrated in FIG. 2, assume that a switch is turned on in a user program stored in the user memory 3 to start a device connected thereto, causing a program 13 to start running on the intelligent module 5 (a starting condition 10). Since this program 13 is stored only in a processing memory 7 of the intelligent module 5, the program 13 is not executed when the intelligent module 5 is not mounted in the PLC. For processing the program 13 even when the intelligent module 5 is not mounted in the same manner as when it is mounted, a modification is required to the user program in the CPU module 1 to add the contents of the program 13 to the user program.
The programming of the intelligent module 5 involves creating a program in a peripheral device, connecting the peripheral device to the intelligent module 5 to transfer the program thereto, and storing the program in the processing memory 7 within the intelligent module 5, as is the case of the programming of the CPU module 1. Thus, when the intelligent module 5 is used as a component forming part of the PLC, the user is required to create a program for the intelligent module 5 separately from a user program stored in the CPU module 1, and to store the created program in the processing memory 7 within the intelligent module 5.
When the intelligent module or modules 5 are added to the PLC with an intention of realizing a control which exhibits superior response performance, settings and operation contents are described individually in each intelligent modules as does the prior art example. As a larger number of intelligent modules are mounted in the PLC, more complicated works are required for changes and modifications.
Specifically, since a program for use in the intelligent program 5 is independent of a program for use in the CPU module 1, respective programs must be installed individually into associated modules, and any modification to a user program in the intelligent module 5 is impossible from the CPU module 1. For this reason, if the PLC does not perform any intended operation upon starting up the system possibly due to some program related cause, a plurality of programs must be modified for respective intelligent modules, thus burdening the user with tedious works.
On the other hand, if the intelligent module 5 is to be removed from a system which has a program configuration in such a manner that the intelligent module 5 is dedicated to operations on input/output data, and the CPU module 1 performs subsequent operations using the results of the operations performed by the intelligent module 5, the processing so far performed by the intelligent module 5 must be added to a use program of the CPU module 1. In consideration of time and labor required to modify associated programs, the system configuration cannot be readily changed.
In some PLC applications, a local PLC may be linked with a remote PLC utilizing a communication module or the like. In this case, a program in a CPU module of the remote PLC can be modified from the local CPU module through the communication module. However, the intelligent module stores programs independent of the CPU module, so that if the remote PLC is mounted with some intelligent module, the operator must go to the location of the remote PLC for modifying relevant programs stored in the intelligent module.
It is therefore an object of the present invention to provide a programmable controller which facilitates modifications to programs running thereon, readily accommodates addition and removal of intelligent modules contained therein, and offers good maintenanceability.
To achieve the above object, the present invention provides a programmable controller comprising a CPU module and an input/output module, and adapted to be connectable with an intelligent module, wherein the CPU module includes a user memory and a processing unit, and the processing unit has a function of determining whether an instruction in an inputted user program should be processed by the CPU module or the intelligent module.
In the programmable controller of the present invention, when the intelligent module is connected to the programmable controller, the CPU module is responsive to the processing unit determining that an inputted user program includes instructions to be executed by the intelligent module to transfer a pertinent portion of the user program to the intelligent module such that a processing unit in the intelligent module processes the portion.
Also, in the programmable controller of the present invention, when no intelligent module is connected to the programmable controller, the CPU module is responsive to the processing unit determining that an inputted user program includes instructions to be executed by the intelligent module to process the pertinent portion of the user program.